package com.dd.cloud.user.service.consule;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dd.cloud.common.constants.TencentConstants;
import com.dd.cloud.user.DTO.tencent.*;
import com.dd.cloud.user.entity.consult.TencentImMsg;
import com.dd.cloud.user.req.consult.ImCreateUserReq;
import com.dd.cloud.user.req.consult.ImUpdateUserReq;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 腾讯im聊天消息表 服务类
 * </p>
 *
 * @author czg
 * @since 2023-07-07
 */
public interface ITencentImMsgService extends IService<TencentImMsg> {

    /**
     * im单聊消息发送后回调
     *
     * @param urlReq url参数
     * @param sinParamReq body参数
     * @return
     */
    ImCallbackRes imSinmsgCallback(HttpServletRequest request, ImCallbackUrlParamReq urlReq, ImCallbackSinParamReq sinParamReq);

    /**
     * im消息已读回调
     *
     * @param urlReq url参数
     * @param readParamReq body参数
     * @return
     */
    ImCallbackRes imReadmsgCallback(HttpServletRequest request, ImCallbackUrlParamReq urlReq, ImCallbackReadParamReq readParamReq);

    /**
     * im消息撤回回调
     *
     * @param urlReq url参数
     * @param recallParamReq body参数
     * @return
     */
    ImCallbackRes imRecallmsgCallback(HttpServletRequest request, ImCallbackUrlParamReq urlReq, ImCallbackRecallParamReq recallParamReq);

    /**
     * im后台给用户发送单聊消息
     *
     * @return
     */
    void imSendmsgSin(ImSendmsgSinParamReq req);

    /**
     * 发送单聊文本消息
     */
    void imSendmsgTest(ImSendmsgSinParamReq sinParamReq);

    /**
     * 发送系统消息
     */
    void imSendmsgSymtem(ImSendmsgSinParamReq sinParamReq, TencentConstants.ImMsgPojo imMsgCustom);

    /**
     * 发送系统消息 添加额外参数
     */
    void imSendmsgSymtem(ImSendmsgSinParamReq sinParamReq, TencentConstants.ImMsgPojo imMsgCustom, String param);

    /**
     * 发送系统消息, 测试用
     */
    void imSendmsgAsymptomSymtem(ImSendmsgSinParamReq req);

    /**
     * 消息回调
     */
    ImCallbackRes imMsgCallback(HttpServletRequest request, ImCallbackUrlParamReq urlReq, Map map);

    /**
     * im创建用户
     */
    void imCreateImUser(List<ImCreateUserReq> list);

    /**
     * 修改用户信息
     * @param user
     */
    void imUpdateImUser(ImUpdateUserReq user);
}
